<!doctype html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../../css/mui.min.css" rel="stylesheet" />
		<link href="../../css/list.css" rel="stylesheet" />
		<script src="../../js/mui.min.js"></script>
		 <script src="../../js/app.js"></script>
		 <script src="../../item/js/common.js"></script>
		 <!--<link href="../css/style.css" rel="stylesheet" />-->
		 <style type="text/css">
		
		/*小盒子内容区的样式，display:inline-block：实现 效果*/
		#con{
			margin: 1px;
		}
		#con .pic{ border-radius:1px;float:left; max-height:180px;overflow:hidden;box-shadow:2px 2px 6px #b5b5b5;line-height:1.2;margin: 5px;padding:2px;}
		#con span{
			padding: 3px;
		}
		/*#con p{*/
			/*margin-bottom: 2px;*/
		/*}*/
		/*#con h5{padding:1px;margin-top: -2px;border-bottom:1px solid #ddd;}*/
		/*#con h5 a{text-decoration:none;color:#999;}*/
		.pic{
			max-width:150px;
			text-align:center;
			min-height:20px;
			padding:5px;
		}
		.pic img{
			margin:0;
			width:100%;
			min-height:10px;
			max-width:100px;
		}
		label{
			width:120px ;
			}
		label img{
			width:100px ;
			height: 20px;
			}
		.mui-input input{
			width: 70%;
			}
			li{list-style:none;}
	</style>
</head>
<body>
	<header class="mui-bar mui-bar-nav">
    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
  <h1 class="mui-title">档案库</h1><p id="titleright" style="float: right;font-size: 0.6em;">举报</p>
</header> 
    <div class="mui-content">
    	<div  style="width:50%;margin:0 auto;text-align:center" id="image"></div>
    	<!--内容-->
      <div id="neirong" class="mui-content-padded"></div>
      <!--图片集合-->
      <div class="slide-box"id="img"></div>
      <!--表格-->
      <div id="table" class="mui-content-padded"></div>
      <!--来源-->
      <div id="source" class="mui-content-padded"></div>
    </div>
    </body>
<script type="text/javascript">
//	var tid=localStorage[htmlname+'id'];
	
	//举报
//主图大图
function imageplay(image,tid){
	document.getElementById('image').innerHTML='<img  style="width:95%;" src="'+home.uploads+'/img/item/team/min'+image+'" onerror="this.onerror=null;this.src=\'../images/iconfont-tianjia.png\'" />';
}
//附图多图//把图片追加到窗口
function imgplay(imgname){
	html='<div id="con"><div class="pic"><span><img src="'+home.uploads+'/img/item/team/'+imgname+'" onerror="this.onerror=null;this.src=\'../datu.jpg\'" /></span></div></div>';
	document.getElementById('img').innerHTML+=html;
}
function jsonarrfor(result){
		if(result.pic){
		var pic='';
		if(result.pic.indexOf(",")){//如果字符串里含有逗号。遍历分割
			var rpic=result.pic.split(",");
				for(var ib=0;ib<rpic.length;ib++){//遍历图片
					imgplay(rpic[ib]);
				}
			}else{//如果只有一个图片无需遍历
				imgplay(rpic[ib]);
			}
  }
		
var birthday=new Date(parseInt(result.birthday) * 1000).format('yyyy年M月d日');
//形象头像
if(result.image && result.image.length>6){
imageplay(result.image,result.id);	
}
val='<div style="text-align:center"><h3>'+result.duty+':'+result.name+'</h3></p><p  style="background: transparent;" onclick="goto('+result.user_id+',\'chat\',\'detail\')"></p><p><span>简介</span><br><span id="synopsis">'+result.synopsis+'</span></p></div></div><li style="border-bottom:solid 1px #333;"><span>影集</span></li>';
//	val+=arrjson[i].id;
document.getElementById('titleright').innerHTML='<div id="report" style="margin-top:10px;float:right">'+result.report+'</div><div style="float:right"><select style="padding:10px;background-color:transparent;" onchange="report('+result.id+',\'item_team\',this)"><option>投诉</option><option>色情</option><option>侵权</option><option>脏话</option><option>诽谤</option><option>低俗</option><option>虚假</option><option>其他</option></select></div>';

document.getElementById('neirong').innerHTML=val;
}

apptoken['tid']=tid;//获取详情id
//alert(apptoken['tid']); 
apptoken['act']='teamdetail';
mui.post(home.hos+'/item?tid='+apptoken['tid'],apptoken,function(data){
//	alert(data);
	if(isJSON(data)){
//      			alert(data);
		result=JSON.parse(data);//获取信息
		jsonarrfor(result);//加载详情信息
		getimg(result.id);//加载图片列表
		}else{
			alert(apptoken['tid']+'页面加载失败，或不存在，请重新尝试');
			return false;
    	}
})
function getimg(tid){
	apptoken['tid']=tid;
	apptoken['act']='teamimg';
	mui.post(home.hos+'/item?tid='+apptoken['tid'],apptoken,function(data){
//		alert(data);
	if(isJSON(data)){
		result=JSON.parse(data);//获取信息

				for(var ib=0;ib<result.length;ib++){//遍历图片
					imgplay(result[ib].img);
				}
		}else{
			alert(apptoken['tid']+'页面加载失败，或不存在，请重新尝试');
			return false;
    	}
})
}
//图片单击大图控制插件
mui.plusReady(function() {
      var loopFlag = false; //默认不支持轮播
      var images = [].slice.call(document.querySelectorAll('.mui-content img'));
      var urls = [];
      images.forEach(function(item) {
        urls.push(item.src);
      });
      mui('.mui-content').on('tap', 'img', function() {
        var index = images.indexOf(this);
        plus.nativeUI.previewImage(urls, {
          current: index,
          loop: loopFlag,
          indicator: 'number'
        });
      });
});

  </script>